package org.jimmy.tang.designpattern.behavior.chain;

/**
 * @author jimmy
 * 
 */
public class TLRequestHandle implements RequestHandle {

    RequestHandle rh;

    public TLRequestHandle(RequestHandle rh) {
        this.rh = rh;
    }

    /* (non-Javadoc)
     * @see org.jimmy.tang.designpattern.behavior.chain.RequestHandle#handleRequest(org.jimmy.tang.designpattern.behavior.chain.Request)
     */
    @Override
    public void handleRequest(Request request) {
        if (request instanceof LeaveRequest) {
            System.out.println("Apply for leave, TL approve.");
        } else {
            rh.handleRequest(request);
        }

    }

}
